# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cntlm
pkgver=4.b35d55c
pkgrel=2
pkgdesc='An NTLM, NTLM2SR, and NTLMv2 authenticating HTTP proxy.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-proxy')
license=('GPL2')
url='https://github.com/bseb/cntlm'
source=("git+https://github.com/bseb/$pkgname.git"
        "$pkgname.service")
backup=('etc/cntlm.conf')
makedepends=('git')
sha512sums=('SKIP'
            '65d78e39d05bfbda19dcd77cf0054f60a09a5e209706b41c85504bbfaac0358fa625e44a7aec8d8d32eba6bd411fa800befa70ade1f2d35254e72b12daf7e3b6')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
	cd "$pkgname/$pkgname-0.92.3"

	./configure

  make
}

package() {
	cd "$pkgname/$pkgname-0.92.3"

  make SYSCONFDIR="$pkgdir/etc" BINDIR="$pkgdir/usr/bin" \
    MANDIR="$pkgdir/usr/share/man" install

  install -Dm 644 "$srcdir/$pkgname.service" \
    "$pkgdir/usr/lib/systemd/system/$pkgname.service"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" ../README.md
  install -Dm 644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

